﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HC.CainiaoPostStation.Models.UIModels;
using HC.CaiNiaoPostStation.DAL;
using HC.CaiNiaoPostStation.Models.VModels;

namespace HC.CaiNiaoPostStation.BLL
{
    public class ExpSelfPickUpBLL
    {
        ViewSelfPickUpExpressDAL selfPickUpExpressDAL = new ViewSelfPickUpExpressDAL();
        /// <summary>
        ///  分页查询快递自提信息列表
        /// </summary>
        /// <param name="keywords"></param>
        /// <param name="stationId"></param>
        /// <param name="recPhone"></param>
        /// <param name="expState"></param>
        /// <param name="startIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public PageModel<ViewSelfPickUpExpressInfo> FindSelfPickUpExpressList(string keywords, int stationId,string recPhone, string expState, int startIndex, int pageSize)
        {
            PageModel<ViewSelfPickUpExpressInfo> pageModel= selfPickUpExpressDAL.FindSelfPickUpExpressList(keywords, stationId, recPhone, expState, startIndex, pageSize);
            if(pageModel.PageList.Count>0)
            {
                pageModel.PageList.ForEach(info =>
                {
                    info.PickText = info.IsPickUp ? "" : "取件";
                });
            }
            return pageModel;
        }
    }
}
